import re
import time

import uuid

from pip._vendor import requests

url_page = 'https://m.mm.enterdesk.com/bizhi/'
ret = requests.get(url=url_page)  #ret是HTML的响应对象
# print(ret.text)
url_lst = re.findall(r'https://up.enterdesk.com/edpic_360_360.*?\.jpg',ret.text)

#发送请求
for url in url_lst:
    res = requests.get(url=url)
    time.sleep(3)
    #将响应数据转化为二进制流数据
    content = res.content
    #将二进制流数据写入文件
    name = str(uuid.uuid1()) + '.jpg'
    with open(name,'wb') as f:
        print('正在下载%s' % name)
        f.write(content)